import socketio

sio = socketio.Client()

@sio.on('online_offline')
def message(data):  # 前面的那个参数是主题
    print(data)


@sio.event
def connect():
    print('connect')


@sio.event
def disconnect():
    print('disconnect')


if __name__ == '__main__':
    sio.connect("http://localhost:5000")
